package com.stylefeng.guns.rest.common.exception;

import com.stylefeng.guns.core.exception.ServiceExceptionEnum;

/**
 * 所有业务异常的枚举
 *
 * @author fengshuonan
 * @date 2016年11月12日 下午5:04:51
 */
public enum BizExceptionEnum implements ServiceExceptionEnum {

    /**
     * 接口返回异常
     */
    RES_SUCCESS(100,"操作成功"),
    RES_FAIL(200,"操作失败"),
    PRIZE_NO_WINNING(201,"很遗憾，没中奖!"),
    PRIZE_NO_reward_balance(202,"积分不足!"),
    PRIZE_Invalid(203,"奖品失效!"),
    ADV_COUPON_LINGQU(204,"已经领取此券!"),
    ADV_COUPON_LINGWAN(205,"券已领完!"),
    ADV_SHIXIAO(206,"已失效!"),
    NEWS_SHIXIAO(207,"内容已被删除!"),
    RES_ChongFu(210,"操作重复"),
    RES_Ad_Code_Abnormal(211,"位置获取异常!"),

    CITY_NOT_OPEN(300,"您所在的城市暂未开放!"),
    NOT_REAL_NAME(301,"需实名认证!"),
    CASH_NUMBER_DAY(302,"每日只能提现一次!"),
    NOT_REAL_NAME_CASH_LIMIT(303,"需实名认证!"),
    cashDayLimit(304,"每次提现限额!"),

    ISV_MISSING(400,"缺少参数"),
    FIRST_ISV_MISSING(401,"第一次注册，请先绑定手机!"),
    ISV_ERROR(402,"参数格式错误："),
    ISV_NAME_ERROR(403,"参数拼写错误："),

    HttpMessageNotReadableException(500,"发送的json数据格式异常"),

    /**
     * token异常
     */
    TOKEN_EXPIRED(700, "token异常"),
    ACCESS_TOKEN_EXPIRED(710, "accessToken过期"),
    FRESH_TOKEN_EXPIRED(720, "freshToken过期"),
    TOKEN_ERROR(730, "token验证失败"),

    /**
     * 签名异常
     */
    SIGN_ERROR(800, "签名验证失败"),

    Cancle_Cache_Success(900, "缓存清除成功"),
    Cancle_Cache_FAil(901, "缓存清除失败"),
    Cancle_Cache_Attr(900, "参数必须为"),
    /**
     * 其他
     */
    AUTH_REQUEST_ERROR(600, "账号密码错误");





    BizExceptionEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private Integer code;

    private String msg;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
